﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
    Control ctr;
    TaiKhoan tk;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //ctr = Page.ParseControl(MyFunction.getXSLT(Server.MapPath("XmlFiles/MenuMyPage.xml"), Server.MapPath("XmlFiles/MenuMyPage.xslt")));
            //asideleft1.Controls.Add(ctr);
            ////ControlCollection controls = asideleft1.Controls;
            //foreach (Control child in asideleft1.Controls[1].Controls)
            //{
            //    if (child is Button)
            //    {
            //        Button btn = (Button)child;
            //        btn.Click += new EventHandler(Button1_Click);
            //    }
            //}
            //menuTaiKhoan.InnerHtml = MyFunction.getXSLT(Server.MapPath("XmlFiles/MenuMyPage.xml"), Server.MapPath("XmlFiles/MenuMyPage.xslt"));
            HttpCookie cookie = Request.Cookies["Acount"];
            if (cookie == null)
            {
                cookie = new HttpCookie("Acount");
                cookie.Expires = DateTime.Now.AddDays(1);
                cookie["Failed"] = "0";
                Response.Cookies.Add(cookie);
            }
            tk = (TaiKhoan)Session["TaiKhoan"];
            if (tk == null)
                Response.Redirect("Login.aspx");
            else
            {
                imgAvarta.Src = tk.Avarta;
                imgAvarta2.Src = tk.Avarta;

            }
            
        }
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {


    }
    protected void Button1_Click1(object sender, EventArgs e)
    {

    }
    protected void refreshCapcha(object sender, ImageClickEventArgs e)
    {
        ImageCapCha.ImageUrl = "";
        ImageCapCha.ImageUrl = "ImageCapcha.aspx";
    }
    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (tbMaAnToan.Value.ToLower() == Session["capcha"].ToString())
            args.IsValid = true;
        else
            args.IsValid = false;
    }
}